package com.gjy.design.observer.disruptor;

import java.util.concurrent.CopyOnWriteArraySet;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-11-08 09:15:16
 */
public class DisruptorEvent {

    private MessageEvent messageEvent;
    private CopyOnWriteArraySet<Subscriber> subscribers;

    public void set(MessageEvent messageEvent, CopyOnWriteArraySet<Subscriber> subscribers) {
        this.messageEvent = messageEvent;
        this.subscribers = subscribers;
    }

    public MessageEvent getMessageEvent() {
        return messageEvent;
    }

    public CopyOnWriteArraySet<Subscriber> getSubscribers() {
        return subscribers;
    }

    public void clear() {
        this.messageEvent = null;
        this.subscribers = null;
    }

}
